package cate.common.table.item.rune.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteField;

public class RuneForgeRow extends ERow {

    @NoteField(value = "参与合成符文类型ID")
    public int type;

    @NoteField(value = "参与合成符文数量")
    public int num;

    @NoteField(value = "资源消耗")
    public String consumeStr;

    @NoteField(value = "合成成功率")
    private double successCfg;

    @NoteField(value = "合成符文类型ID")
    public int resultType;

    @NoteField("失败获得道具")
    public String failRewardStr;

    public int value;

    @Override
    public void parse(XSSFRowWrap xr) {
        this.id = xr.getInteger("合成方式");
        this.type = xr.getInteger("参与合成徽章类型ID", 0);
        this.num = xr.getInteger("参与合成徽章数量", 0);
        this.consumeStr = xr.getString("资源消耗");
        this.successCfg = xr.getDouble("合成成功率", 0.0);
        this.resultType = xr.getInteger("合成徽章类型ID");
        this.failRewardStr = xr.getString("失败获得道具");
        this.value = xr.getInteger("熔炼值");
    }
    /** 合成成功率 */
    public double successRate;

    @Override
    public void decode() {
        if (successCfg > 0 && successCfg <= 10000) {
            successRate = successCfg / 10000;
        }
    }
}
